'    Copyright 2008 Jan Molnar <jan.molnar@abds.de>
'
'    This file is part of JCQ.

'    JCQ is free software: you can redistribute it and/or modify
'    it under the terms of the GNU General Public License as published by
'    the Free Software Foundation, either version 2 of the License, or
'    (at your option) any later version.

'    JCQ is distributed in the hope that it will be useful,
'    but WITHOUT ANY WARRANTY; without even the implied warranty of
'    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'    GNU General Public License for more details.

'    You should have received a copy of the GNU General Public License
'    along with JCQ. If not, see <http://www.gnu.org/licenses/>.

Public NotInheritable Class Kernel
    Private Shared _Mapper As Interfaces.IMapper = New Mapper
    Private Shared _ServiceProvider As Interfaces.IServiceProvider(Of Interfaces.IService) = New ServiceProvider(Of Interfaces.IService)
    Private Shared _Logger As Interfaces.ILoggingService = Services.GetService(Of Interfaces.ILoggingService)()
    Private Shared _TaskScheduler As Interfaces.ITaskScheduler = New SimpleTaskScheduler

    Private Sub New()

    End Sub

    ''' <summary>
    ''' Provides services derived from IService.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property Services() As Interfaces.IServiceProvider(Of Interfaces.IService)
        Get
            Return _ServiceProvider
        End Get
    End Property

    Public Shared ReadOnly Property TaskScheduler() As Interfaces.ITaskScheduler
        Get
            Return _TaskScheduler
        End Get
    End Property

    ''' <summary>
    ''' Provides exception handling.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Shared ReadOnly Property Exceptions() As Interfaces.Exceptions.IExceptionService
        Get
            Return Services.GetService(Of Interfaces.Exceptions.IExceptionService)()
        End Get
    End Property

    Public Shared ReadOnly Property Logger() As Interfaces.ILoggingService
        Get
            Return _Logger
        End Get
    End Property

    Public Shared ReadOnly Property Mapper() As Interfaces.IMapper
        Get
            Return _Mapper
        End Get
    End Property
End Class
